.PHONY: build extract label finetune predict iv regress report clean

build:
	docker build -t digi-risk .

extract:
	docker run --rm -v $(PWD)/data:/workspace/data digi-risk python src/01_extract.py

label:
	docker run --rm -it -v $(PWD)/data:/workspace/data digi-risk python src/03_labeling.py

finetune:
	docker run --rm --gpus all -v $(PWD):/workspace digi-risk python src/04_finetune.py

predict:
	docker run --rm --gpus all -v $(PWD):/workspace digi-risk python src/05_predict.py

iv:
	docker run --rm -v $(PWD):/workspace digi-risk python src/06_iv_build.py

regress:
	docker run --rm -v $(PWD):/workspace digi-risk python src/07_regression.py

report:
	docker run --rm -v $(PWD):/workspace digi-risk jupyter nbconvert --execute --to html notebooks/08_robust.ipynb

pipeline: extract preprocess label finetune predict iv regress report
	@echo "🎉 全流程结束，结果见 outputs/ 与 notebooks/"

clean:
	rm -rf data/txt data/filtered outputs/* models/finbert-risk
